# -*- coding: utf-8 -*-
from distutils.core import setup
import py2exe
import sys

# this allows to run it with a simple double click.
sys.argv.append('py2exe')

py2exe_options = {
    # "includes": ["sip"], # PySide需要模块
    "dll_excludes": ["MSVCP90.dll",], # 需要排除的dll文件,如果不排除的话会报 No such file or directory错误
    "compressed": 2, # 是否压缩library.zip,当zipfile不为None时使用
    "optimize": 2, # 优化级别,默认为0
    "ascii": 0, # 不自动包含encodings和codecs,默认为0,包含
    "bundle_files": 1, # 3:不打包,2:打包除了Python解释器,1:当zipfile=None,生成一个exe文件,否则还生成一个library.zip
}

setup(
    name = u'富文本编辑器', # 产品名称
    version = '1.3', # 版本
    description = u"zhangjia_86@126.com", # 文件说明
    windows = [{'script': 'richtextedit.py', 'icon_resources': [(1, 'image/app.ico')]}], # GUI程序
    # console = [{'script': 'test.py', 'icon_resources': [(1, 'images/1.ico')]}], # CLI程序
    zipfile = None, # 共享压缩文件的名字,None为打包到exe中，默认为library.zip
    options = {'py2exe': py2exe_options},
)

import os
os.system('copy dist\\richtextedit.exe richtextedit.exe')
os.system('rd dist /s /q')
os.system('rd build /s /q')
